// 统一管理首页模块的接口
import request from "@/utils/request";

// 引入TS类型
import type {AxiosHomeResponse,HospitalLevelResponse} from '@/api/home/type.ts'

enum BASE_LINK {
    HOSPITAL_LINK = '/hosp/hospital',
    DICT_CODE_LINK = '/cmn/dict/findByDictCode'
}

/**
 * 获取医院列表信息的API
 * @param page 当前页数
 * @param limit 每页显示多少个
 * @returns
 */
export const getHospitalListApi = (page:number=1,limit:number=10) => {
    return request<any,AxiosHomeResponse,any>({
        url:`${BASE_LINK.HOSPITAL_LINK}/${page}/${limit}`,
        method:'GET'
    })
}

/**
 * 获取医院等级和区域的的接口
 * @param dictCode 要传入的字符串
 * @returns 
 */
export const getHospitalLevelAndReginApi = (dictCode:string) => {
    return request<any,HospitalLevelResponse,any>({
        method:'GET',
        url:`${BASE_LINK.DICT_CODE_LINK}/${dictCode}`
    })
}